package com.tobie.info.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tobie.info.entity.HotelEntity;
import com.tobie.info.mapper.HotelMapper;
import com.tobie.info.mapper.PositionMapper;
import com.tobie.info.service.IHotelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author lc
 * @Date 2023/11/17 17:03
 * @注释 酒店信息实现类
 */
@Slf4j
@Service
public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> implements IHotelService {

    @Resource
    private HotelMapper hotelMapper;

    @Resource
    private PositionMapper positionMapper;

    @Override
    public List<HotelEntity> getAllHotel() {
        return hotelMapper.getAllHotel();
    }

    /*
    *  根据用户输入位置模糊查询所有酒店
    */
    @Override
    public List<HotelEntity> getHotelByPositionName(String positionName) {
        log.info(positionName);
        List<HotelEntity> hotelEntities = hotelMapper.getHotelByPositionName(positionName);
        log.info(hotelEntities.toString());
        return hotelEntities;
    }
}
